package at.horario.model;

//~--- JDK imports ------------------------------------------------------------

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.io.Serializable;

/**
 * Base class for Model objects.  Child objects should implement toString(),
 * equals() and hashCode();
 * <p/>
 * <p>
 * <a href="GenericObject.java.html"><i>View Source</i></a>
 * </p>
 *
 * @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a>
 */
public abstract class GenericObject<PK extends Serializable> implements Serializable {

    /**
     * Method descricao
     *
     * @return
     */
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }

    /**
     * Method descricao
     *
     * @param o
     * @return
     */
    public abstract boolean equals(Object o);

    /**
     * Method descricao
     *
     * @return
     */
    public abstract int hashCode();

    public abstract PK getId();

}
